#!/bin/sh
echo "导入ods的数据到客户基表中"
hive -v -e "set hive.exec.mode.local.auto=true;load data local inpath '/xm/c.txt' overwrite into table ods02.ods_cust_info_02;"
echo $?
echo "导入dw的数据到地址码表中"
hive -v -e "set hive.exec.mode.local.auto=true;load data local inpath '/xm/p.txt' overwrite into table dw02.dw_addr_info_02;"
echo $?
echo "导入dw的数据到产品码表中"
hive -v -e "set hive.exec.mode.local.auto=true;load data local inpath '/xm/p2.txt' overwrite into table dw02.dw_product_info_02;"
echo $?
echo "统计三张来源表的数据量"
c=`hive -e "set hive.exec.mode.local.auto=true;select count(*) from ods02.ods_cust_info_02;"`
echo "客户基表本次抽取的数据量为：${c}条"
c1=`hive -e "set hive.exec.mode.local.auto=true;select count(*) from dw02.dw_addr_info_02;"`
echo "地址码表本次抽取的数据量为：${c1}条"
c2=`hive -e "set hive.exec.mode.local.auto=true;select count(*) from dw02.dw_product_info_02;"`
echo "产品码表本次抽取的数据量为：${c2}条"
echo "抽数完成，请自行验证！"